package com.jzr.bedside.ui.adapter

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.jzr.bedside.R
import com.jzr.bedside.bean.OrderListBean


class DrugChildAdapter(data: MutableList<OrderListBean.DataBean>?) :
    BaseQuickAdapter<OrderListBean.DataBean, BaseViewHolder>(
        R.layout.item_drug_child,
        data
    ) {

    override fun convert(helper: BaseViewHolder?, item: OrderListBean.DataBean?) {
        if (helper?.layoutPosition!! % 2 == 0) {
            helper.getView<View>(R.id.item_doctor_advice)
                .setBackgroundColor(mContext.resources.getColor(R.color.white))
        }

        helper.setText(R.id.tvDoctorName, item?.doctorName)
        helper.setText(R.id.tvEnterTime, item?.enterTime)
        helper.setText(R.id.tvStartTime, item?.startTime)
        helper.setText(R.id.tvDrugName, item?.drugName)
        helper.setText(R.id.tvNumber, helper.layoutPosition.toString())
    }
}